#!/usr/bin/env coffee

require './dev/__init__'

require('../koa/koa') (app)->
    require('./dev/error') app
    app.use require('../koa/access_control_dev')
    run = (port)->
        console.log "http://127.0.0.1:"+port
        app.listen(port)

    run(
        (process.argv.pop() - 0) or require('../config/dev').PORT
    )

